/*
* @author dumeng
*/
'use strict'
import request from '@/utils/request'

/**
 * 获取小组分类列表
 */
export function getClassifyTree(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/activityClassify/getClassifyTree',
    method: 'POST',
    data
  })
}

/**
 * 获取小组列表
 * @param {*} query
 */
export function getGroupList(query) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/interestGroup/queryPage',
    method: 'post',
    data: query
  })
}

/**
 * 导出小组人员----脱敏
 * @param {*} data
 */
export function exportUserMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/interestGroupUser/groupUserMaskingExport',
    method: 'post',
    responseType: 'blob',
    data
  })
}
/**
 * 导出小组人员----不脱敏
 * @param {*} data
 */
export function exportUserNoMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/interestGroupUser/groupUserNoMaskingExport',
    method: 'post',
    responseType: 'blob',
    data
  })
}

/**
 * 启用、禁用
 * @param {*} data
 */
export function updateState(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/interestGroup/updateStatus',
    method: 'post',
    data
  })
}

/**
 * 创建小组
 * @param {*} data
 */
export function insert(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/interestGroup/insert',
    method: 'post',
    data
  })
}

/**
 * 获取小组信息 -用户编辑回显
 * @param {*} id
 */
export function get(id) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/interestGroup/get',
    method: 'post',
    data: { id }
  })
}

/**
 * 更新小组
 * @param {*} data
 */
export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/interestGroup/update',
    method: 'post',
    data
  })
}

/**
 * 删除小组
 * @param {*} ids
 */
export function del(ids) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/interestGroup/delete',
    method: 'post',
    data: { ids }
  })
}

/**
 * 获取小组成员
 * @param {*} data
 */
export function queryUser(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/interestGroupUser/queryPage',
    method: 'post',
    data
  })
}
/**
 * 获取小组管理员
 * @param {*} data
 */
export function queryManage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/interestGroupUser/queryPageAdminUser',
    method: 'post',
    data
  })
}

